﻿using System;
using System.Collections;

namespace YArchitech.HCLoad.XmlData
{
	public class DefaultWallCollect : Hashtable
	{
		public DefaultWallCollect(Building building)
		{
			this.parent = building;
		}

		public Building Parent
		{
			get
			{
				return this.parent;
			}
			set
			{
				this.parent = value;
			}
		}

		public void AddDefaultWall(DefaultWall defaultWall)
		{
			try
			{
				defaultWall.Parent = this;
				int wallId = defaultWall.WallId;
				this.Add(wallId, defaultWall);
			}
			catch (Exception ex)
			{
				throw new Exception(ex.ToString());
			}
		}

		public void RemoveDefaultWall(int WallId)
		{
			try
			{
				this.Remove(WallId);
			}
			catch (Exception ex)
			{
				throw new Exception(ex.ToString());
			}
		}

		public DefaultWall GetDefaultWall(int WallId)
		{
			DefaultWall result;
			try
			{
				result = (DefaultWall)this[WallId];
			}
			catch (Exception ex)
			{
				throw new Exception(ex.ToString());
			}
			return result;
		}

		private Building parent;
	}
}
